<!doctype html>



  


<html class="theme-next pisces use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="javascript,洋洋,wangyang" />





  <link rel="alternate" href="/atom.xml" title="前端-洋洋" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="一、显示信息的命令123456789101112131415&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;    &amp;lt;title&amp;gt;常用console命令&amp;lt;/title&amp;gt;    &amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=u">
<meta property="og:type" content="article">
<meta property="og:title" content="九个Console命令，让js调试更简单">
<meta property="og:url" content="http://html-js.site/2016/08/19/九个Console命令，让js调试更简单/index.html">
<meta property="og:site_name" content="前端-洋洋">
<meta property="og:description" content="一、显示信息的命令123456789101112131415&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;    &amp;lt;title&amp;gt;常用console命令&amp;lt;/title&amp;gt;    &amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=u">
<meta property="og:image" content="http://html-js.site/images/page/console/1.png">
<meta property="og:image" content="http://html-js.site/images/page/console/2.png">
<meta property="og:image" content="http://html-js.site/images/page/console/3.png">
<meta property="og:image" content="http://html-js.site/images/page/console/4.png">
<meta property="og:image" content="http://html-js.site/images/page/console/5.png">
<meta property="og:image" content="http://html-js.site/images/page/console/6.png">
<meta property="og:image" content="http://html-js.site/images/page/console/7.png">
<meta property="og:image" content="http://html-js.site/images/page/console/8.png">
<meta property="og:updated_time" content="2016-08-19T04:18:53.104Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="九个Console命令，让js调试更简单">
<meta name="twitter:description" content="一、显示信息的命令123456789101112131415&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;    &amp;lt;title&amp;gt;常用console命令&amp;lt;/title&amp;gt;    &amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=u">
<meta name="twitter:image" content="http://html-js.site/images/page/console/1.png">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>




  <link rel="canonical" href="http://html-js.site/2016/08/19/九个Console命令，让js调试更简单/"/>

  <title> 九个Console命令，让js调试更简单 | 前端-洋洋 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?ca98d1db5559cb59848d14443c7fa5dd";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">前端-洋洋</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">专注于前端</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                九个Console命令，让js调试更简单
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2016-08-19T12:02:45+08:00" content="2016-08-19">
              2016-08-19
            </time>
          </span>

          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2016/08/19/九个Console命令，让js调试更简单/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2016/08/19/九个Console命令，让js调试更简单/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="一、显示信息的命令"><a href="#一、显示信息的命令" class="headerlink" title="一、显示信息的命令"></a><strong>一、显示信息的命令</strong></h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">    &lt;title&gt;常用console命令&lt;/title&gt;</span><br><span class="line">    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">    &lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">        console.log(&apos;hello&apos;);</span><br><span class="line">        console.info(&apos;信息&apos;);</span><br><span class="line">        console.error(&apos;错误&apos;);</span><br><span class="line">        console.warn(&apos;警告&apos;);</span><br><span class="line">    &lt;/script&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<p>最常用的就是console.log了。</p>
<h2 id="二：占位符"><a href="#二：占位符" class="headerlink" title="二：占位符"></a><strong>二：占位符</strong></h2><p>onsole上述的集中度支持printf的占位符格式，支持的占位符有：字符（%s）、整数（%d或%i）、浮点数（%f）和对象（%o）<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">   console.log(&quot;%d年%d月%d日&quot;,2011,3,26);</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure></p>
<p>效果：<br><img src="/images/page/console/1.png" alt=""></p>
<h2 id="三、信息分组"><a href="#三、信息分组" class="headerlink" title="三、信息分组"></a><strong>三、信息分组</strong></h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">    &lt;title&gt;常用console命令&lt;/title&gt;</span><br><span class="line">    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">    &lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">        console.group(&quot;第一组信息&quot;);</span><br><span class="line"></span><br><span class="line">    　　　　console.log(&quot;第一组第一条:我的博客(http://www.ido321.com)&quot;);</span><br><span class="line"></span><br><span class="line">    　　　　console.log(&quot;第一组第二条:CSDN(http://blog.csdn.net/u011043843)&quot;);</span><br><span class="line"></span><br><span class="line">    　　console.groupEnd();</span><br><span class="line"></span><br><span class="line">　　    console.group(&quot;第二组信息&quot;);</span><br><span class="line"></span><br><span class="line">    　　　　console.log(&quot;第二组第一条:程序爱好者QQ群： 259280570&quot;);</span><br><span class="line"></span><br><span class="line">    　　　　console.log(&quot;第二组第二条:欢迎你加入&quot;);</span><br><span class="line"></span><br><span class="line">　　    console.groupEnd();</span><br><span class="line">    &lt;/script&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<p>效果：<br><img src="/images/page/console/2.png" alt=""></p>
<h2 id="四、查看对象的信息"><a href="#四、查看对象的信息" class="headerlink" title="四、查看对象的信息"></a><strong>四、查看对象的信息</strong></h2><p>console.dir()可以显示一个对象所有的属性和方法。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">    var info = &#123;</span><br><span class="line">        blog:&quot;http://www.ido321.com&quot;,</span><br><span class="line">        QQGroup:259280570,</span><br><span class="line">        message:&quot;程序爱好者欢迎你的加入&quot;</span><br><span class="line">    &#125;;</span><br><span class="line">    console.dir(info);</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure></p>
<p>效果：<br><img src="/images/page/console/3.png" alt=""></p>
<h2 id="五、显示某个节点的内容"><a href="#五、显示某个节点的内容" class="headerlink" title="五、显示某个节点的内容"></a><strong>五、显示某个节点的内容</strong></h2><p>console.dirxml()用来显示网页的某个节点（node）所包含的html/xml代码。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&lt;!DOCTYPE html&gt;</span><br><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">    &lt;title&gt;常用console命令&lt;/title&gt;</span><br><span class="line">    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">    &lt;div id=&quot;info&quot;&gt;</span><br><span class="line">        &lt;h3&gt;我的博客：www.ido321.com&lt;/h3&gt;</span><br><span class="line">        &lt;p&gt;程序爱好者:259280570,欢迎你的加入&lt;/p&gt;</span><br><span class="line">    &lt;/div&gt;</span><br><span class="line">    &lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">        var info = document.getElementById(&apos;info&apos;);</span><br><span class="line">        console.dirxml(info);</span><br><span class="line">    &lt;/script&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure></p>
<p>效果：<br><img src="/images/page/console/4.png" alt=""></p>
<h2 id="六、判断变量是否是真"><a href="#六、判断变量是否是真" class="headerlink" title="六、判断变量是否是真"></a><strong>六、判断变量是否是真</strong></h2><p>console.assert()用来判断一个表达式或变量是否为真。如果结果为否，则在控制台输出一条相应信息，并且抛出一个异常。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">　　var result = 1;</span><br><span class="line">　　console.assert( result );</span><br><span class="line">　　var year = 2014;</span><br><span class="line">　　console.assert(year == 2018 );</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure></p>
<p>1是非0值，是真；而第二个判断是假，在控制台显示错误信息<br><img src="/images/page/console/5.png" alt=""></p>
<h2 id="七、追踪函数的调用轨迹。"><a href="#七、追踪函数的调用轨迹。" class="headerlink" title="七、追踪函数的调用轨迹。"></a><strong>七、追踪函数的调用轨迹。</strong></h2><p>console.trace()用来追踪函数的调用轨迹。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">/*函数是如何被调用的，在其中加入console.trace()方法就可以了*/</span><br><span class="line">　　function add(a,b)&#123;</span><br><span class="line">        console.trace();</span><br><span class="line">　　　　return a+b;</span><br><span class="line">　　&#125;</span><br><span class="line">　　var x = add3(1,1);</span><br><span class="line">　　function add3(a,b)&#123;return add2(a,b);&#125;</span><br><span class="line">　　function add2(a,b)&#123;return add1(a,b);&#125;</span><br><span class="line">　　function add1(a,b)&#123;return add(a,b);&#125;</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure></p>
<p>控制台输出信息：<br><img src="/images/page/console/6.png" alt=""></p>
<h2 id="八、计时功能"><a href="#八、计时功能" class="headerlink" title="八、计时功能"></a><strong>八、计时功能</strong></h2><p>console.time()和console.timeEnd()，用来显示代码的运行时间。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">　　console.time(&quot;控制台计时器一&quot;);</span><br><span class="line">　　for(var i=0;i&lt;1000;i++)&#123;</span><br><span class="line">　　　　for(var j=0;j&lt;1000;j++)&#123;&#125;</span><br><span class="line">　　&#125;</span><br><span class="line">　　console.timeEnd(&quot;控制台计时器一&quot;);</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure></p>
<p>运行时间是38.84ms<br><img src="/images/page/console/7.png" alt=""></p>
<h2 id="九、console-profile-的性能分析"><a href="#九、console-profile-的性能分析" class="headerlink" title="九、console.profile()的性能分析"></a><strong>九、console.profile()的性能分析</strong></h2><p>性能分析（Profiler）就是分析程序各个部分的运行时间，找出瓶颈所在，使用的方法是console.profile()。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">&lt;script type=&quot;text/javascript&quot;&gt;</span><br><span class="line">　　function All()&#123;</span><br><span class="line">        alert(11);</span><br><span class="line">　　　　     for(var i=0;i&lt;10;i++)&#123;</span><br><span class="line">            funcA(1000);</span><br><span class="line">         &#125;</span><br><span class="line">　　　　    funcB(10000);</span><br><span class="line">　　    &#125;</span><br><span class="line"></span><br><span class="line">　　function funcA(count)&#123;</span><br><span class="line">　　　　for(var i=0;i&lt;count;i++)&#123;&#125;</span><br><span class="line">　　&#125;</span><br><span class="line"></span><br><span class="line">　　function funcB(count)&#123;</span><br><span class="line">　　　　for(var i=0;i&lt;count;i++)&#123;&#125;</span><br><span class="line">　　&#125;</span><br><span class="line"></span><br><span class="line">　　console.profile(&apos;性能分析器&apos;);</span><br><span class="line">　　All();</span><br><span class="line">　　console.profileEnd();</span><br><span class="line">&lt;/script&gt;</span><br></pre></td></tr></table></figure></p>
<p>输出如图：<br><img src="/images/page/console/8.png" alt=""></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/wechat.jpg" alt="wangyang WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/alipay.jpg" alt="wangyang Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/08/18/如何优雅地使用Sublime Text/" rel="next" title="工欲善其事必先利其器-sublimetext使用技巧">
                <i class="fa fa-chevron-left"></i> 工欲善其事必先利其器-sublimetext使用技巧
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2016/08/19/九个Console命令，让js调试更简单/"
           data-title="九个Console命令，让js调试更简单" data-url="http://html-js.site/2016/08/19/九个Console命令，让js调试更简单/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/default_avatar.jpg"
               alt="wangyang" />
          <p class="site-author-name" itemprop="name">wangyang</p>
          <p class="site-description motion-element" itemprop="description">专注于前端</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">15</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">23</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/WangYang-Rex" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/u/2690568063/" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="617418875" target="_blank" title="QQ">
                  
                    <i class="fa fa-fw fa-qq"></i>
                  
                  QQ
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="mailto:617418875@qq.com" target="_blank" title="Mail">
                  
                    <i class="fa fa-fw fa-envelope-o"></i>
                  
                  Mail
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友链
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://http://moshui.site/" title="moxhuis" target="_blank">moxhuis</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://indexof.site/" title="indexof" target="_blank">indexof</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://xiaoqiang730730.github.io/" title="xiaoqiang" target="_blank">xiaoqiang</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#一、显示信息的命令"><span class="nav-number">1.</span> <span class="nav-text">一、显示信息的命令</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二：占位符"><span class="nav-number">2.</span> <span class="nav-text">二：占位符</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三、信息分组"><span class="nav-number">3.</span> <span class="nav-text">三、信息分组</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#四、查看对象的信息"><span class="nav-number">4.</span> <span class="nav-text">四、查看对象的信息</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#五、显示某个节点的内容"><span class="nav-number">5.</span> <span class="nav-text">五、显示某个节点的内容</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#六、判断变量是否是真"><span class="nav-number">6.</span> <span class="nav-text">六、判断变量是否是真</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#七、追踪函数的调用轨迹。"><span class="nav-number">7.</span> <span class="nav-text">七、追踪函数的调用轨迹。</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#八、计时功能"><span class="nav-number">8.</span> <span class="nav-text">八、计时功能</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#九、console-profile-的性能分析"><span class="nav-number">9.</span> <span class="nav-text">九、console.profile()的性能分析</span></a></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">wangyang</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.0.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"html-js"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/vendors/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  

</body>
</html>
